home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2008 May / PersonalComputerWorld-May2008-CoverdiscCD.iso / Software / Full / Nero 7 / Installation / Cab / A97B5616.cab / iFrameContentFocus6AF1B77E.js < prev    next >
Encoding:
JavaScript  |  2006-06-28  |  1.7 KB  |  26 lines

  1.  
  2.  
  3. /* This script provides invisible focusable elements at the top. bottom, left and right of a frame-content page. When you focus on
  4.  
  5.   any of these, the focus will automatically go back up to the parent page that contains the frame. This allows you to jump the
  6.  
  7.   focus back and forth between the parent and child pages; when you click past the last button in any direction you hit one of
  8.  
  9.   these placeholders and the focus moves back to the parent page. (The reason they are positioned so far off the visible page is
  10.  
  11.   to make sure that each is focusable from any element on the page when you hit the arrow for that direction.) */
  12.  
  13.   
  14.  
  15. var pageWidth = body.scrollWidth
  16.  
  17. var pageHeight = body.scrollHeight
  18.  
  19.  
  20.  
  21. //document.write ('<span MCFocusable="true" style="position: absolute; top: -1000; left: 0; width: 100%; height: 20;" onfocus="sendFocusBackToParent()"></span>') // top element
  22.  
  23. //document.write ('<span MCFocusable="true" style="position: absolute; top: ' + (pageHeight + 1000) + '; left: 0; width: 100%; height: 20;" onfocus="body.scrollTop=0;sendFocusBackToParent()"></span>') // bottom element
  24.  
  25.  
  26.  
  27. document.write ('<span MCFocusable="true" style="position: absolute; top: 0; left: -1000; width: 20; height: 100%;" onfocus="sendFocusBackToParent()"></span>') // left element
  28.  
  29.  
  30.  
  31. //document.write ('<span MCFocusable="true" style="position: absolute; top: 0; left: ' + (pageWidth+1000) +'; width: 20; height: 100%;" onfocus="body.scrollLeft=0;sendFocusBackToParent()"></span>') // right element
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39. function sendFocusBackToParent()
  40.  
  41. {
  42.  
  43.     //this function sends the focus back to the parent page    
  44.  
  45.     oCurFocus = null
  46.  
  47.     window.top.moveFocusBackToIFrame();
  48.  
  49. }
  50.  
  51.